<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function getsum(x, y) {
            var sum = 0;
            for (var i = x; i <= y; i++) {
                sum += i;
            }
            return sum;
        }

        function getp(x, y) {
            var sum = x;
            for (var i = x; i <= y; i++) {
                sum *= i;
            }
            return sum;
        }
        document.write("5-10之间数相加等于" + getsum(5, 10) + "<br>");
        document.write("<br>100-1000之间数相加等于" + getsum(100, 1000));
    </script>
</body>

</html>